/*
 * Copyright 2007 by ChinanetCenter Corporation.
 *
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * ChinanetCenter Corporation ("Confidential Information").  You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with ChinanetCenter.
 * 
 */
package com.szf.base.dao.ibatis;

import javax.servlet.http.HttpServletRequest;

import com.szf.base.dao.Page;

public class IBatisPage extends Page {

	private static final long serialVersionUID = 6283356916580119457L;

	//查询Sql Map语句id
	private String statementId;

	//查询参数值对象(可为Javabean,Map等)
	private Object paramValue;

	/**
	 * 根据HttpServletRequest创建hql对象
	 *
	 * @param request 
	 */
	public IBatisPage(HttpServletRequest request) {
		super(request);
		statementId = null;
		paramValue = null;
	}

	public IBatisPage() {
		super();
		statementId = null;
		paramValue = null;
	}

	/**
	 * 设置iBatis执行查询语句Sql Map的statementId及执行查询总计数(如果需要返回查询总记录数)<br>
	 * <p/>
	 * 示例如下<br>
	 * <pre>
	 * //一、用Map作为参数查询：<br>
	 * Map map = new HashMap();
	 * map.put("codeType","0010");
	 * map.put("codeTypeName","机构类型");
	 * <p/>
	 * sqlWrapper.setParameter("codeType.searchCodeType","codeType.countCodeTypeCount",map);
	 * <p/>
	 * //二、配置SQL Map文件
	 * </pre>
	 *
	 * @param statementId      调用iBatis的SqlMap文件的声明段名，规则名：SqlMap的namespace+"." + 该sqlMap文件某片段的id
	 * @param paramValue       查询条件的值，可为JavaBean,Map对象。
	 */
	public void setParameter(String statementId, Object paramValue) {
		this.statementId = statementId;
		this.paramValue = paramValue;
	}

	public String getStatementId() {
		return statementId;
	}

	public void setStatementId(String statementId) {
		this.statementId = statementId;
	}

	public Object getParamValue() {
		return paramValue;
	}

	public void setParamValue(Object paramValue) {
		this.paramValue = paramValue;
	}
}
